<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>圣杯布局</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="container">
        <div class="header">Header</div>
        <div class="content">
            <div class="main">Main Content</div>
            <div class="sidebar-left">Left Sidebar</div>
            <div class="sidebar-right">Right Sidebar</div>
        </div>
        <div class="footer">Footer</div>
    </div>
</body>
<style>
   /* 全局样式 */
body, html {
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    margin: 0 auto;
}

.header, .footer {
    background-color: #f5f5f5;
    padding: 10px;
    text-align: center;
}

/* 内容区设置 */
.content {
    padding: 0 200px; /* 为左右栏预留空间 */
}

/* 主内容区 */
.main {
   float: left;
   background-color: blueviolet;
   width: 100%;
}

/* 左侧边栏 */
.sidebar-left {
    width: 200px;
    float: left;
    background-color: red;
    margin-left: -100%;
    position: relative;
    right: 200px;
}

/* 右侧边栏 */
.sidebar-right {
    float: left;
    width: 200px;
    background-color: orange;
    margin-right: -200px;
}

/* 清除浮动 */
.content::after {
    content: '';
    display: block;
    clear: both;
}

</style>
</html>
